<?php

namespace projects\Bundle\BattleShipBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;

use projects\Bundle\BattleShipBundle\Entity\Role;

class DefaultController extends Controller
{

	/**
     * @Route("/pruebas/{name}")
     */
    public function indexAction($name)
    {
    	$role = new Role();
    	$role->setName($name);
		$em = $this->getDoctrine()->getManager();
		$em->persist($role);
		$em->flush();
        return $this->render('battleShipBundle:Default:index.html.twig', array('name' => $role->getName()));
    }
}
